package com.fagp.mew.cms.permission;


import com.mew.common.util.MD5Encrypt;
import org.springframework.security.crypto.password.PasswordEncoder;

/**
 * 自定义密码比较器 3
 */
public class Md5PasswordEncoder implements PasswordEncoder {

    @Override
    public String encode(CharSequence charSequence) {
        return charSequence.toString();
    }


    @Override
    public boolean matches(CharSequence charSequence, String s) {
        String md5 = MD5Encrypt.MD5(charSequence.toString());
        return md5.equals(s);
    }


}
